﻿@{
    ViewBag.Title = "搜索结果";
}

<input type="hidden" id="hdSearchText" value="@ViewBag.QueryString" />
  <div style="border-bottom:solid 1px #669900; height:25px; z-index:999;">
        <div class="divCurrent divTab" data-contentid="divResultContentSongs"  data-url="/CustControl/SongsListTmpl">歌曲</div>
         <div class="divBCurrent divTab" data-contentid="divResultContentAlbums"  data-url="/CustControl/AlbumsTmpl" style="left:100px; border-left:none;" >专辑</div>
         @*<div class="divBCurrent divTab"  style="left:100px; border-left:none;" >歌手</div>*@
    </div> 
<div  id="divResultContentSongs">@Html.Action("SongsListTmpl", "CustControl", new { s=ViewBag.QueryString})</div>  
<div  id="divResultContentAlbums" style="display:none;">@Html.Action("AlbumsTmpl", "CustControl", new { s=ViewBag.QueryString})</div>  
<div  id="divResultContentSingers"></div>  

<script type="text/javascript">
    $(document).ready(function () {
        var searchtext = $("#hdSearchText").val();
        $("#txtQText").val(searchtext);
        var s = $("#hdSearchText").val();
        $(".divTab").click(function () {
            $(".divTab").not(this).removeClass("divCurrent").addClass("divBCurrent");
            $(this).removeClass("divBCurrent");
            $(this).addClass("divCurrent");
            $("#" + $(".divTab").not(this).attr("data-contentID")).hide();
            $("#" + $(this).attr("data-contentID")).show();
        });        

        $("#txtQText").each(function () {
            var target = $(this);
            target.autocomplete({ source: "/Home/QuickSearch" });
        });

        $("#btnSearch").click(function () {
            var s = $("#txtQText").val();
            window.location = "/Home/SearchResult/?s=" + s;
        });
    });   
</script>
